<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
      <title>GTL - Graph Template Library: components.h Source File</title>
      <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <p class="links">  
      <a href="../index.html">Home</a> |
      Documentation |
      <a href="../register.html">Download</a> |
      <a href="../platforms.html">Platforms</a> |
      <a href="../refer.html">Projects</a> |      
      <a href="../lists.html">Mailing Lists</a> |
      <a href="../history.html">Version History</a>
    </p>

<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>components.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">//   components.h</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
<a name="l00006"></a>00006 <span class="comment">// $Id: components.h,v 1.5 2003/04/03 11:44:42 raitner Exp $</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef GTL_COMPONENTS_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define GTL_COMPONENTS_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;GTL/GTL.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;GTL/dfs.h&gt;</span>
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;list&gt;</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 __GTL_BEGIN_NAMESPACE
<a name="l00020"></a><a class="code" href="a00007.html">00020</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00007.html" title="Connected components algorithm.">components</a> : <span class="keyword">public</span> <a class="code" href="a00008.html" title="Depth-First-Search (DFS) algorithm.">dfs</a> 
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00028"></a>00028     <a class="code" href="a00007.html" title="Connected components algorithm.">components</a> ();
<a name="l00029"></a>00029 
<a name="l00035"></a><a class="code" href="a00007.html#a38e55d08dd484dad3175617264056a5">00035</a>     <span class="keyword">virtual</span> ~<a class="code" href="a00007.html" title="Connected components algorithm.">components</a> () {}
<a name="l00036"></a>00036 
<a name="l00049"></a>00049     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a00008.html#908f4ea617ed59767ed334b39a2771d0" title="Checks whether the preconditions for DFS are satisfied.">check</a> (<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00050"></a>00050 
<a name="l00051"></a>00051     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00008.html#1c893f699517cc72624cf171b7bc4da4" title="Resets algorithm.">reset</a> ();
<a name="l00052"></a>00052 
<a name="l00056"></a>00056     <span class="keyword">typedef</span> list&lt;pair&lt;list&lt;node&gt;, list&lt;edge&gt; &gt; &gt;::iterator component_iterator;
<a name="l00057"></a>00057 
<a name="l00070"></a><a class="code" href="a00007.html#8a645639044375cdaefabffda3ae70e0">00070</a>     component_iterator components_begin ()
<a name="l00071"></a>00071         { <span class="keywordflow">return</span> comp.begin(); }
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 
<a name="l00080"></a><a class="code" href="a00007.html#8537c6e4c6a29a4ae05a937b5fda1fb9">00080</a>     component_iterator components_end ()
<a name="l00081"></a>00081         { <span class="keywordflow">return</span> comp.end(); }
<a name="l00082"></a>00082 
<a name="l00088"></a><a class="code" href="a00007.html#50cab789f53f3d225a70bc4cbfd3c7b5">00088</a>     <span class="keywordtype">int</span> number_of_components ()<span class="keyword"> const</span>
<a name="l00089"></a>00089 <span class="keyword">        </span>{<span class="keywordflow">return</span> num_of_components; }
<a name="l00090"></a>00090 
<a name="l00091"></a>00091     <span class="comment">//-----------------------------------------------------------------------</span>
<a name="l00092"></a>00092     <span class="comment">//   Handler used to extend dfs to biconnectivity</span>
<a name="l00093"></a>00093     <span class="comment">//-----------------------------------------------------------------------</span>
<a name="l00097"></a>00097 <span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00008.html#e3f095c9fe6106e82c24543da4844ea3" title="Handler called when a unused node n connected to the actual node by e is found.">before_recursive_call_handler</a> (<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp;, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>&amp;, <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp;);
<a name="l00098"></a>00098 
<a name="l00102"></a>00102     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00008.html#df1c667188e632761c63f529537c544c" title="Handler called when a already marked node n connected to the actual node by e is...">old_adj_node_handler</a> (<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp;, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>&amp;, <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp;);
<a name="l00103"></a>00103 
<a name="l00107"></a>00107     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00008.html#3b5fbea7a7baed9946cfb4444a7f20ea" title="Called when DFS is started with start-node n.">new_start_handler</a> (<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp;, <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp;);    
<a name="l00108"></a>00108 
<a name="l00109"></a>00109 
<a name="l00110"></a>00110 <span class="keyword">protected</span>:
<a name="l00111"></a>00111 
<a name="l00115"></a>00115     <span class="keywordtype">int</span> num_of_components;
<a name="l00119"></a>00119     list&lt;pair&lt;list&lt;node&gt;, list&lt;edge&gt; &gt; &gt; comp;
<a name="l00123"></a>00123     component_iterator li;
<a name="l00124"></a>00124 };
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 __GTL_END_NAMESPACE
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="preprocessor">#endif // GTL_BICONNECTIVITY_H</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span>
<a name="l00130"></a>00130 <span class="comment">//--------------------------------------------------------------------------</span>
<a name="l00131"></a>00131 <span class="comment">//   end of file</span>
<a name="l00132"></a>00132 <span class="comment">//--------------------------------------------------------------------------</span>
</pre></div>    <p class="links">
      <a href="http://www.uni-passau.de/">University of Passau</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/">FMI</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
	Computer Science</a>
    </p>
  <div class="copyright">
      Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>,  University of Passau 
  </div>
</body>
</html>
